<?php
/**
 * Created by IntelliJ IDEA.
 * User: Fernando
 * Date: 15/10/2014
 * Time: 23:46
 */
use Symfony\Component\HttpKernel\Controller\ControllerReference;
echo $view['actions']->render(new ControllerReference('FiestissimaCRM:Index:header'));

?>
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h2 class="page-header">Clientes </h2>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <i class="fa fa-users fa-fw"></i> Particulares
                </div>
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="table-responsive" id="divTableClientesParticulares">
                        <?php
                        if(count($clientes)>0)
                        {
                            ?>
                            <table class="table table-bordered table-hover table-striped" id="tableClientesEmpresa">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Apellido</th>
                                    <th>Nombre</th>
                                    <th>Tipo Documento</th>
                                    <th>Nro Documento</th>
                                    <th>&nbsp;</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach($clientes as $c)
                                {
                                    echo "
                                        <tr>
                                            <td>".$c->getCId()."</td>
                                            <td>".$c->getCpApellido()."</td>
                                            <td>".$c->getCpNombre()."</td>
                                            <td>".$c->getCTipoDoc()."</td>
                                            <td>".$c->getCNroDoc()."</td>
                                            <td>
                                                <button id=\"btnVerDetalle\" type=\"button\" class=\"btn btn-primary btn-sm\" data-toggle=\"modal\" data-target=\"#agregarClienteModal\">
                                                <i class=\"fa fa-edit fa-fw\"></i> Ver detalles
                                                </button>
                                            </td>
                                        </tr>
                                    ";
                                }
                                ?>
                                </tbody>
                            </table>
                                <?php
                                }else {
                                    echo "No hay empresas registradas como clientes.";
                                }
                                ?>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.col-lg-4 (nested) -->
                    </div>
                    <!-- /.row -->
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->

<!-- /#wrapper -->

<?php echo $view->render('FiestissimaCRM:Default:footer.html.php'); ?>